package org.wj.arithmetic

import org.apache.spark.rdd.RDD
import org.wj.config.LocalSparkContext

/**
 * 对两个RDD进行交集运算
 */
object Intersection extends App with LocalSparkContext{

  private val rdd1: RDD[Int] = sc.parallelize(1 to 50)
  private val rdd2: RDD[Int] = sc.parallelize(30 to 50)

  rdd1.intersection(rdd2).foreach(println(_))

}
